package com.gzedu.module.dao.meun.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Repository;

import com.gzedu.common.sys.dao.impl.BaseDao;
import com.gzedu.module.dao.meun.IMeunDao;
import com.gzedu.module.modle.meun.Meun;

@Repository
public class MeunDaoImpl extends BaseDao<Meun> implements IMeunDao {
	@Resource
	private SqlSessionFactory sqlSessionFactory;

	public SqlSessionFactory getSqlSessionFactory() {
		return sqlSessionFactory;
	}

	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		this.sqlSessionFactory = sqlSessionFactory;
	}

	public List<Meun> findByRoleCode(String roleCode) {
		// TODO Auto-generated method stub
		SqlSession session = this.getSqlSessionFactory().openSession();
		return session.selectList(super.getStatement() + ".findByRoleCode", roleCode);
	}
}
